]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
windowManager: Clean up starting of size-change animations a bit
authorJonas Dreßler <verdre@v0yd.nl>
Tue, 12 May 2020 10:22:52 +0000 (12:22 +0200)
committerRobert Mader <robert.mader@posteo.de>
Mon, 15 Jun 2020 13:12:03 +0000 (13:12 +0000)
We can do without having two calls to shellwm.completed_size_change() in
there, so use an early return for all cases.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1251

js/ui/windowManager.js

index 3dacca2ecaa4e8c93f0dbe2e44ee00cf6ce79590..e05c02305aba792b41f40eb3ebd17f593ae743e7 100644 (file)
@@ -1278,13 +1278,13 @@ var WindowManager = class {
     }
 
     _sizeChangeWindow(shellwm, actor, whichChange, oldFrameRect, _oldBufferRect) {
-        let types = [Meta.WindowType.NORMAL];
-        if (!this._shouldAnimateActor(actor, types)) {
-            shellwm.completed_size_change(actor);
-            return;
-        }
+        const types = [Meta.WindowType.NORMAL];
+        const shouldAnimate =
+            this._shouldAnimateActor(actor, types) &&
+            oldFrameRect.width > 0 &&
+            oldFrameRect.height > 0;
 
-        if (oldFrameRect.width > 0 && oldFrameRect.height > 0)
+        if (shouldAnimate)
             this._prepareAnimationInfo(shellwm, actor, oldFrameRect, whichChange);
         else
             shellwm.completed_size_change(actor);